package com.example.jixeishi1.service.impl;

import com.example.jixeishi1.dao.GoodsDao;
import com.example.jixeishi1.entity.Order;
import com.example.jixeishi1.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.SQLException;
import java.util.List;
@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    GoodsDao goodsDao;


    @Override
    public List getGoods(int id) throws SQLException {
        List goods=goodsDao.getGoods(id);
        System.out.println("商品基础信息："+goods);
        return goods;
    }

    @Override
    public List getDetails(int pid) throws SQLException {
        List details=goodsDao.getDetails(pid);
        System.out.println("详情"+details);

        return details;
    }

    @Override
    public List getCf_p(int pid) throws SQLException {
        List cf_p=goodsDao.getCf_p(pid);
        System.out.println("配置+价格"+cf_p);

        return cf_p;
    }

    @Override
    public List getEvaluate(int id) throws SQLException {
        List evaluate=goodsDao.getEvaluate(id);
        System.out.println("用户评价"+evaluate);

        return evaluate;
    }

    @Override
    public List getProperty(int cid) throws SQLException {
        List property=goodsDao.getProperty(cid);
        return property;
    }

    @Override
    public List getHotGoods() throws SQLException {
        List hotgoods=goodsDao.getHotGoods();

        return hotgoods;
    }

    @Override
    public int addOrder(Order order) throws SQLException {
        int s=goodsDao.addOrder(order);
        return s;
    }

    @Override
    public List getAddress(int uid) throws SQLException {
        List dzxx=goodsDao.getAddress(uid);
        return dzxx;
    }

}
